package com.market.order.server.mapper;

import java.util.List;

import com.market.common.core.domain.Result;
import com.market.order.common.domain.TOrder;
import com.market.order.common.domain.vo.VoOrder;
import org.apache.ibatis.annotations.Param;

/**
 * 订单Mapper接口
 *
 * @author market
 * @date 2024-02-26
 */
public interface TOrderMapper
{
    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    public TOrder selectTOrderByOrderId(Integer orderId);

    /**
     * 查询订单列表
     *
     * @param tOrder 订单
     * @return 订单集合
     */
    public List<TOrder> selectTOrderList(TOrder tOrder);

    /**
     * 新增订单
     *
     * @param tOrder 订单
     * @return 结果
     */
    public int insertTOrder(TOrder tOrder);

    /**
     * 修改订单
     *
     * @param tOrder 订单
     * @return 结果
     */
    public int updateTOrder(TOrder tOrder);

    /**
     * 删除订单
     *
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteTOrderByOrderId(Integer orderId);

    /**
     * 批量删除订单
     *
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTOrderByOrderIds(Integer[] orderIds);

    List<TOrder> selectOrderList(VoOrder voOrder);


    Integer cancel(@Param("orderId") Integer orderId);

    Integer updateOrderStatus(@Param("orderId") Integer orderId, @Param("orderStatus") Integer orderStatus);

    void paysuccess(@Param("outTradeNo") String outTradeNo, @Param("totalAmount") String totalAmount);

    void updateInventory(@Param("orderId") Integer orderId, @Param("productQuantity") Integer productQuantity);

    List<TOrder> selectAll(@Param("userId") List<Long> userId);
}
